import React ,{useEffect}from 'react';
import {Switch,Route,Redirect,BrowserRouter} from 'react-router-dom'
import { Layout} from 'antd';
import {L2Dwidget} from 'live2d-widget'
import Axios from 'axios'
import './app.less'
import 'antd/dist/antd.less';
import MyHeader from './components/header/header';
import MyFooter from './components/footer/footer'

import {Home} from './pages/home/home'
import Video from './pages/video/video'
import Skill from './pages//skill/skill'
import Life from './pages/life/life'
import PassageDe from './pages/passage_detail/passage_detail'

const { Header, Footer, Content } = Layout;

const App = () => {
  
  /* useEffect(()=>{
    Axios.get('http://localhost:4000/passage_info').then((result)=>{
      console.log("这是返回的结果",result)
    }).then(err=>{
      console.log(err)
    })
  },[]) */
  return (

    <Layout>
      <Header className='header-container'>
        <MyHeader/>
      </Header>
      <Content className="content-container"> 
      {
        //路由搭建
      }
      <Switch>
        <Route path='/'  exact component={Home}/>
        <Route path='/video' component={Video}/>
        <Route path='/skill' component={Skill}/>
        <Route path='/life' component={Life}/>
        <Route path='/passagedetail/:passageID' exact component={PassageDe}/>
        <Redirect to='/'/>
      </Switch>
      </Content>
      <Footer >
        <MyFooter/>
      </Footer>
    </Layout>


  );
}

export default App;
